<?php

namespace App\Http\Controllers\Api;

use App\Http\Resources\UserPermissionCollection;
use App\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class PermissionController extends Controller
{
    public function index(Request $request){
        $user=User::find($request->user()->id);
        $permission=$user->getAllPermissions();
        return new UserPermissionCollection($permission);
    }
}
